<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    function Person(){
	this.name = 'xiaohui';//属性
	this.age = 20
    this.run = function(){//方法
        console.log(this.name + '在运动')
    }
}

Person.prototype.work = function(){
    console.log(`我今年${this.age}岁了`)
}

let p = new Person()
console.log(p.name)
p.run()
p.work()
</script>
</html>